<section class="content-header">
    <h1>
        刀具图纸维护
    </h1>
</section>

<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-md-3 col-md-push-9">
            <div class="box box-default">
                <div class="box-header with-border">
                    <h3 class="box-title">查询区域</h3>
                    <div class="box-tools pull-right">
                        <button type="button" class="btn btn-box-tool" data-widget="collapse">
                            <i class="fa fa-minus"></i>
                        </button>
                        <button type="button" class="btn btn-box-tool" data-widget="remove">
                            <i class="fa fa-remove"></i>
                        </button>
                    </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                    <div class="form-group">
                        <label>查询类型</label>
                        <dx-select-box #tool style="width:100%;height:35px;margin-bottom:10px;border-radius: 0px" [items]="toolAttachmentTypes" displayExpr="typeName"
                            [(selectedItem)]="toolAttachmentTypeSelected" [value]="toolAttachmentTypeSelected" [searchEnabled]="true">
                        </dx-select-box>
                    </div>
                    <div class="form-group">
                        <label>刀具ID</label>
                        <input type="text" [(ngModel)]='queryModel.toolKey' class="form-control pull-right" placeholder="刀具ID" />
                        <!-- <dx-select-box style="width:100%;height:35px;margin-bottom:10px;border-radius: 0px" [searchEnabled]="true">
                        </dx-select-box> -->
                    </div>
                </div>
                <div class="box-footer">
                    <button type="button" class="btn btn-primary" (click)="getReportData()"> 查 询 </button>
                </div>
            </div>
        </div>
        <div class="col-md-9 col-md-pull-3">
            <div class="box box-default">
                <div class="box-header with-border">
                    <h3 class="box-title">数据展示</h3>
                    <div class="box-tools pull-right">
                        <button type="button" class="btn btn-info btn-sm" data-toggle="modal" data-target="#excleImportModal" title="数据导入">
                            <i class="fa fa-file-excel-o"></i>
                        </button>
                        <!-- <button type="button" (click)="saveChanges()" class="btn btn-info btn-sm" data-toggle="tooltip" title="保存">
                            <i class="fa fa-save"></i>
                        </button> -->
                        <button type="button" class="btn btn-info btn-sm" data-widget="collapse">
                            <i class="fa fa-minus"></i>
                        </button>
                    </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body">

                    <dx-data-grid [dataSource]="items" on [showColumnLines]="true" [showRowLines]="true" [showBorders]="true" [rowAlternationEnabled]="true">
                        <dxo-paging [pageSize]="10"></dxo-paging>
                        <dxo-pager [showPageSizeSelector]="true" [allowedPageSizes]="[10, 20, 100]" [showInfo]="true">
                        </dxo-pager>
                        <dxo-editing mode="cell" [allowUpdating]="true">
                        </dxo-editing>
                        <!-- <dxi-column [allowEditing]="false" cellTemplate="cellTemplate" caption="过滤" [width]="60">
                            </dxi-column> -->
                        <dxi-column [allowEditing]="false" dataField="fileName" caption="刀具图纸文件名">
                        </dxi-column>
                        <dxi-column [allowEditing]="false" caption="查看" [width]="180" [allowSorting]="false" cellTemplate="cellTemplate">

                        </dxi-column>
                        <div *dxTemplate="let data of 'cellTemplate'">
                            <button type="button" class="btn-group" (click)="viewpdf(data.data)">
                                查看
                            </button>
                            <button type="button" class="btn-group" (click)="downpdf(data.data)">
                                下载
                            </button>
                            <button type="button" class="btn-group" (click)="delpdf(data.data)">
                                删除
                            </button>
                        </div>
                    </dx-data-grid>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="excleImportModal" tabindex="-1" role="dialog" aria-labelledby="myLabel">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="myLabel">刀具图纸导入</h4>
                </div>
                <div class="modal-body">
                    <div class="blue clearfix">
                        <input type="file" ng2FileSelect [uploader]="uploader" />
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" (click)="importExcel()" data-dismiss="modal">导入</button>
                    <button type="button" class="btn btn-primary" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
</section>